package com.example.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.util.List;

/**
 * @program: springboot_course
 * @description: 用户实体类
 * @author: ChenZhiXiang
 * @create: 2019-06-10 15:30
 **/
@Document(collection = "user")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User implements Serializable {

    private static final long serialVersionUID = 6222176558369919436L;

    /** 文档编码，主键 */
    @Id
    private Long id;

    /** 在MongoDB中使用user_name保存 */
    @Field("user_name")
    private String userName;

    private String note;

    private List<Role> roles;

}
